home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #9 / Commodore_Disk_User_Vol.3_9_1990_-.d64 / file recovery (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  109 lines

  1. 0 rem        ******************
  2. 1 rem    ******              ******
  3. 2 rem  ****         file         ****
  4. 3 rem ****    recovery program    ****
  5. 4 rem ****                        ****
  6. 5 rem ****  written by m.carroll  ****
  7. 6 rem  ****      march 1990      ****
  8. 7 rem    ******              ******
  9. 8 rem        ******************
  10. 9 :
  11. 10 sys65409:poke51,0:poke52,90:poke55,0
  12. 20 poke56,90:clr:dimd(35,20),s(255)
  13. 30 poke54296,0:sys65418:fort=1to35
  14. 40 reada:forb=0toa:d(t,b)=-1:next
  15. 50 print".";:next:poke53265,0:d(18,0)=0
  16. 60 data20,20,20,20,20,20,20,20,20,20
  17. 70 data20,20,20,20,20,20,20,0,18,18
  18. 80 data18,18,18,18,17,17,17,17,17,17
  19. 90 data16,16,16,16,16
  20. 100 poke53280,0:poke53281,0:poke808,251
  21. 110 fora=679to744:readb:pokea,b:next
  22. 120 print"[147][153]"tab(9)"[198]ile [210]ecovery [208]rogram."
  23. 130 printtab(9)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  24. 140 print"[211]pecify start addresses to be searched  for, use [210][197][212][213][210][206] to confirm."
  25. 150 poke53265,27:open1,0,0:input#1,a$:close1:a$=a$+" "
  26. 160 iflen(a$)/5<>int(len(a$)/5)then120
  27. 170 dima(len(a$)/5-1):n=0
  28. 180 fora=1tolen(a$)-4step5
  29. 190 b$=mid$(a$,a,4)
  30. 200 forc=0to3:a(n)=a(n)*16
  31. 210 a(n)=a(n)+asc(mid$(a$,a+c,4))-48+7*(asc(mid$(a$,a+c,4))>64):next
  32. 220 n=n+1:next:n=n-1
  33. 230 sys65511:print:poke198,0
  34. 240 print"[147][208]ress any key to start formatting a     fresh disc...":poke198,0
  35. 250 wait198,1:poke198,0
  36. 260 print"[147][207]kay...":t1=1:t2=1:b1=0:b2=0
  37. 270 open15,8,15,"u;"
  38. 280 print#15,"m-w"chr$(105)chr$(0)""
  39. 290 print#15,"n0:recovered files,rf"
  40. 300 get#15,a,a$,b,b:ifathen290
  41. 310 fora=0to498step166
  42. 320 print"[147][201]nsert damaged disc and press [211][208][193][195][197]..."
  43. 330 poke198,0:wait198,1:poke198,0
  44. 340 print"[147][207]kay - reading from disc..."
  45. 350 forb=0to165
  46. 360 ifnot(d(t1,b1))thenb=b-1:goto410
  47. 370 open5,8,5,"#"
  48. 380 print#15,"u1:"5;0;t1;b1
  49. 390 print#15,"b-p:5,0"
  50. 400 poke698,b+90:sys679:close5
  51. 410 b1=b1+1:ifb1=21thenb1=0:t1=t1+1
  52. 420 next
  53. 430 print"[147][201]nsert fresh disc and press [211][208][193][195][197]..."
  54. 440 poke198,0:wait198,1:poke198,0
  55. 450 print"[147][207]kay - writing to disc..."
  56. 460 forb=0to165
  57. 470 ifnot(d(t2,b2))thenb=b-1:goto520
  58. 480 open5,8,5,"#":poke726,90+b
  59. 490 print#15,"b-p:5,0":sys712
  60. 500 print#15,"u2:"5;0;t2;b2
  61. 510 close5
  62. 520 b2=b2+1:ifb2=21thenb2=0:t2=t2+1
  63. 530 next:next
  64. 540 data162,5,32,198,255,160,0,32,207,255,72,120,169,,133,1,104,153,,,169,55
  65. 550 data133,1,88,200,208,235,162,,76,198,255,162,5,32,201,255,160,,120,169,,133
  66. 560 data1,185,,,72,169,55,133,1,88,104,32,210,255,200,208,235,162,3,76,201,255
  67. 570 print"[147][207]kay - searching disc..."
  68. 580 open5,8,5,"#"
  69. 590 print#15,"u1:5,0,18,0"
  70. 600 print#15,"b-p:5,4"
  71. 610 fora=0to139:print#5,chr$(0);
  72. 620 next:print#15,"u2:5,0,18,0"
  73. 630 close5:t=1:b=-1:s=1
  74. 640 fora=0to255:s(a)=0:next:s(1)=255:fe=0:goto660
  75. 650 ifd(t,b)then690
  76. 660 b=b+1:ifb=21thenb=0:t=t+1
  77. 670 ift=36then890
  78. 680 goto650
  79. 690 open5,8,5,"#"
  80. 700 print#15,"u1:"5;0;t;b
  81. 710 print#15,"b-p:5,2"
  82. 720 get#5,a$,b$,c$,c$:close5
  83. 730 sa=asc(a$+chr$(0))+asc(b$+chr$(0))*256:bs=b$=c$
  84. 740 a=0
  85. 750 ifsa<>a(a)then870
  86. 760 f$=right$("00"+right$(str$(fe+s*8-8),len(str$(fe+s*8-8))-1),3)
  87. 770 a$="-m/c at":ifbsthena$="-bas at"
  88. 780 f$="[130]"+chr$(t)+chr$(b)+f$+a$+right$("    "+str$(sa),6)
  89. 790 fora=1to19:s(fe*32+1+a)=asc(mid$(f$,a,1)):next
  90. 800 fe=(fe+1)and7:iffethen870
  91. 810 s(0)=18:s(1)=s+1
  92. 820 open5,8,5,"#":print#15,"b-p:5,0"
  93. 830 fora=0to255:print#5,chr$(s(a));
  94. 840 next:print#15,"u2:"5;0;18;s
  95. 850 close5:s=s+1:ifs<19then640
  96. 860 print"[147][206]ot enough room!":goto900
  97. 870 a=a+1:ifnot(n<a)then750
  98. 880 goto660
  99. 890 print"[147][207]kay - finished."
  100. 900 open5,8,5,"#"
  101. 910 print#15,"b-p:5,0"
  102. 920 fora=0to255:print#5,chr$(s(a));
  103. 930 next:print#15,"u2:"5;0;18;s
  104. 940 close5:close15
  105. 950 print"[157]"s*8-8+fe"files found."
  106. 960 poke198,10:fora=631to640
  107. 970 readb:pokea,b:next:poke808,237
  108. 980 data76,79,65,68,34,36,34,44,56,13
  109.